// https://leetcode.cn/problems/distribute-candies/
// Created by ade on 2022/8/9.
//
#include <iostream>
#include <vector>
#include <algorithm>


using namespace std;

class Solution {
public:
    int distributeCandies(vector<int> &candyType) {
        int n = candyType.size() / 2;
        sort(candyType.begin(), candyType.end());
        int k = unique(candyType.begin(), candyType.end()) - candyType.begin();
        return min(n, k);
    }
};

int main() {
    Solution so;
    vector<int> nums = {1, 1, 2, 2, 3, 3};
    cout << so.distributeCandies(nums);
    return 0;
}